﻿using NHibernate.Mappings;
using System;

namespace Apollo.Modules.Salary
{
    [NHibernateEntity(Table = "TransactionDefinitionMappings")]
    public class TransactionDefinitionMapping : IHistory<TransactionDefinitionMapping>, ITrackable
    {
        public TransactionDefinitionMapping() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [BelongsTo(Column = "ID_TransactionDefinition")]
        public virtual TransactionDefinition TransactionDefinition { get; set; }

        [BelongsTo(Column = "ID_EmployeeComponentDefinition")]
        public virtual EmployeeComponentDefinition EmployeeComponentDefinition { get; set; }

        [Property]
        public virtual TransactionAffects Affects { get; set; }

        [Property]
        public virtual double MinValue { get; set; }

        [Property]
        public virtual double MaxValue { get; set; }

        [Property]
        public virtual TransactionFlow Flow { get; set; }


        [BelongsTo(Column = "ID_BelonsTo_TransactionDefinitionMapping")]
        public virtual TransactionDefinitionMapping BelongsTo { get; set; }

        [Property]
        public virtual DateTime EffectiveDate { get; set; }

        [Property]
        public virtual DateTime LearnDate { get; set; }

        [Property]
        public virtual State State { get; set; }



        [Property]
        public virtual DateTime InsertDate { get; set; }

        [Property]
        public virtual string InsertBy { get; set; }

        [Property]
        public virtual DateTime? ModifiedDate { get; set; }

        [Property]
        public virtual string ModifiedBy { get; set; }
    }

    public enum TransactionAffects
    {
        None = -1,
        BaseIncome = 0,
        GrossIncome = 1,
        NetIncome = 2,
        Component = 3,
        PaymentTotal = 4,
    }

}
